miscellaneous functions
Xgr ( )
XgrBorderNameToNumber ( border$, @border )
XgrBorderNumberToName ( border, @border$ )
XgrBorderNumberToWidth ( border, @width )
XgrCreateFont ( @font, fontName$, fontSize, fontWeight, fontItalic, fontAngle )
XgrCursorNameToNumber ( cursorName$, @cursorNumber )
XgrCursorNumberToName ( cursorNumber, @cursorName$ )
XgrDestroyFont ( font )
XgrGetClipboard ( clipboard, @clipType, @text$, @image[] )
XgrGetCursor ( @cursor )
XgrGetDisplaySize ( display$, @width, @height, @borderWidth, @titleHeight )
XgrGetFontInfo ( font, @fontName$, @fontSize, @fontWeight, @fontItalic, @fontAngle )
XgrGetFontMetrics ( font, @maxCharWidth, @maxCharHeight, @ascent, @DECent, @gap, @flags )
XgrGetFontNames ( @count, @fontNames$[] )
XgrGetKeystateModify ( state, @modify, @edit )
XgrGetTextImageSize ( font, text$, @dx, @dy, @width, @height, @topGap, @flags )
XgrIconNameToNumber ( iconName$, @iconNumber )
XgrIconNumberToName ( iconNumber, @iconName$ )
XgrRegisterCursor ( cursorName$, @cursor )
XgrRegisterIcon ( iconName$, @icon )
XgrSetClipboard ( clipboard, clipType, @text$, @image[] )
XgrSetCursor ( cursor, @oldCursor )
version$ = XgrVersion$ ( )
 

Xgr  ( ) 

Xgr() initializes GraphicsDesigner. Every program or library that calls a graphics function must call Xgr() before any others. Calling Xgr() more than once has no harmful effects.

XgrBorderNameToNumber  ( border$, @border ) 

XgrBorderNameToNumber() converts a border name into a border number appropriate for XgrDrawBorder() functions.

XgrBorderNumberToName  ( border, @border$ ) 

XgrBorderNumberToName() converts a border number into a border name.

XgrBorderNumberToWidth  ( border, @width ) 

XgrBorderNumberToWidth() converts a border number into the width of the border in pixels.

XgrCreateFont  ( @font, fontName$, fontSize, fontWeight, fontItalic, fontAngle ) 

XgrCreateFont() creates a font of the specified fontName$, fontSize, fontWeight, fontItalic, fontAngle, and returns its font number. All other functions that specify a font pass font as an argument. 

fontName$ is the typeface name, fontSize is ten times the point size, fontWeight is boldness from very thin to very heavy (0 to 1000), fontItalic is tilt from none to extreme (0 to 1000), and fontAngle is the angle the characters are rotated from horizontal in 1/10 degree units (1800 = 180 degrees = upside down). 

If fontName$ cannot be found or the requested font cannot be created for any reason, 0 is returned in font . The default font is 0 , so the font number returned by XgrCreateFont() is always valid, though the characters may not look like those expected when the specified font is not found.

XgrCursorNameToNumber  ( cursorName$, @cursorNumber ) 

XgrCursorNameToNumber() returns the cursorNumber assigned to cursorName$ by XgrRegisterCursor() .

XgrCursorNumberToName  ( cursorNumber, @cursorName$ ) 

XgrCursorNumberToName() returns the cursorName$ to which XgrRegisterCursor() assigned cursorNumber .

XgrDestroyFont  ( font ) 

XgrDestroyFont() destroys font . The same font number may subsequently be assigned to a new font, so programs should not use the font number of a destroyed font.

XgrGetClipboard  ( clipboard, @clipType, @text$, @image[] ) 

XgrGetClipboard() returns the current contents of clipboard in text$ and/or image[] , depending on the type of data in clipboard , which is returned in clipType . The interapplication clipboard, also called the system clipboard, is clipboard=0 . 

clipType = 0 = $$ClipboardTypeNone 
clipType = 1 = $$ClipboardTypeText 
clipType = 2 = $$ClipboardTypeImage 

XgrGetCursor  ( @cursor ) 

XgrGetCursor() returns the currently displayed cursor .

XgrGetDisplaySize  ( display$, @width, @height, @borderWidth, @titleHeight ) 

XgrGetDisplaySize() returns the width,height of display$ in pixels, as well as the borderWidth and titleHeight of windows that have borders and title-bars. 

display$ = "" denotes the default display.

XgrGetFontInfo  ( font, @fontName$, @fontSize, @fontWeight, @fontItalic, @fontAngle ) 

XgrGetFontInfo() returns fontName$, fontSize, fontWeight, fontItalic, and fontAngle for font .  

See XgrCreateFont() for details.

XgrGetFontMetrics  ( font, @maxCharWidth, @maxCharHeight, @ascent, @DECent, @gap, @flags ) 

XgrGetFontMetrics() returns the maximum character width in pixels, maximum character height in pixels, the ascent from the baseline of the tallest character, the DECent from the baseline for the lowest character, the gap at the top that is normally interline spacing, but may contain active character pixels for unusual characters, including characters with accents and umlauts. 

XgrGetFontNames  ( @fontName$[] ) 

XgrGetFontNames() returns the names of all typefaces from which fonts can be created by XgrCreateFont() . 

XgrGetKeystateModify  ( state, @modify, @edit ) 

XgrGetKeystateModify() estimates whether a #KeyDown message with the specified state argument would normally modify text in a common text grids like XuiTextLine and XuiTextArea .

XgrGetTextImageSize  ( font, text$, @dx, @dy, @width, @height, @gap, @flags ) 

XgrGetTextImageSize() computes the (dx,dy) change in drawpoint and the (width,height) of the smallest rectangle that contain the text image of text$ when drawn with font . 

Since font includes a rotation attribute, the image of the text string may be tipped from the horizontal, shifting the drawpoint vertically as well as horizontally. This fact is reflected in (dx,dy), but not (width,height) because the size of the smallest rectangle does not change as text strings are rotated.

XgrIconNameToNumber  ( iconName$, @iconNumber ) 

XgrIconNameToNumber() converts iconName$ into the iconNumber originally assigned it by XgrRegisterIcon() . 
If iconName$ was never registered, iconNumber = 0 . 

XgrIconNumberToName  ( iconNumber, @iconName$ ) 

XgrIconNumberToName() converts iconNumber into the iconName$ it was created for by XgrRegisterIcon() . 

If iconNumber has not been assigned to any icon by XgrRegisterIcon(), iconName$ = "" .

XgrRegisterCursor  ( cursorName$, @cursorNumber ) 

XgrRegisterCursor() assigns a unique cursorNumber for cursorName$, or returns its existing cursorNumber if cursorName$ has already been registered.

XgrRegisterIcon  ( iconName$, @iconNumber ) 

XgrRegisterIcon() assigns a unique iconNumber for iconName$, or returns its existing iconNumber if iconName$ has already been registered.

XgrSetClipboard  ( clipboard, clipType, @text$, @image[] ) 

XgrSetClipboard() installs text$ and/or image[] into clipboard, depending on the type of data specified by clipType . The system clipboard is clipboard=0 . 

clipType = 0 = $$ClipboardTypeNone 
clipType = 1 = $$ClipboardTypeText 
clipType = 2 = $$ClipboardTypeImage 

XgrSetCursor  ( cursor, @oldCursor ) 

XgrSetCursor() sets the current cursor and returns the oldCursor . The displayed cursor changes to cursor .

version$ = XgrVersion$  ( ) 

XgrVersion$() returns the current GraphicsDesigner version$ .